package top.i51213.fastaction.tuple;

import androidx.annotation.NonNull;

public class Tuple2<A, B> extends Tuple{
    public A item1;
    public B item2;

    public Tuple2(A a, B b) {
        this.item1=a;
        this.item2=b;
    }

    @Override
    public int dimensionCount() {
        return 2;
    }

    @Override
    public Object get(int index) {
        switch (index){
            case 1:return item1;
            case 2:return item2;
        }
        return null;
    }

    @NonNull
    @Override
    public String toString() {
        return "Tuple2{" +
                "item1=" + item1 +
                ", item2=" + item2 +
                '}';
    }
}
